/* Timeline Sidebar View Styles */
div[data-type^="tg-timeline-sidebar-view"] .timeline-sidebar-container {
	display: flex;
	flex-direction: column;
	height: 100%;
	width: 100%;
	background-color: var(--background-primary);
	overflow: hidden;
	font-family: var(--font-interface);
	padding: 0 !important;
}

/* Header */
div[data-type^="tg-timeline-sidebar-view"] .timeline-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: var(--size-4-3) var(--size-4-4);
	border-bottom: 1px solid var(--background-modifier-border);
	background: linear-gradient(
		135deg,
		var(--background-secondary) 0%,
		var(--background-modifier-hover) 100%
	);
	flex-shrink: 0;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-title {
	font-weight: 600;
	font-size: var(--font-ui-medium);
	color: var(--text-normal);
	display: flex;
	align-items: center;
	gap: var(--size-4-2);
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-controls {
	display: flex;
	gap: var(--size-4-2);
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--size-4-8);
	height: var(--size-4-8);
	border-radius: var(--radius-s);
	cursor: pointer;
	color: var(--text-muted);
	background-color: transparent;
	transition: all 0.2s ease;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-btn:hover {
	color: var(--text-normal);
	background-color: var(--background-modifier-hover);
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-btn.is-active {
	color: var(--text-on-accent);
	background-color: var(--interactive-accent);
}

/* Timeline Content */
div[data-type^="tg-timeline-sidebar-view"] .timeline-content {
	flex: 1;
	overflow-y: auto;
	padding: var(--size-4-2) 0;
	position: relative;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-content.focus-mode
	.timeline-date-group:not(.is-today) {
	opacity: 0.3;
	pointer-events: none;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--text-muted);
	font-style: italic;
	text-align: center;
	padding: var(--size-4-8);
}

/* Date Groups */
div[data-type^="tg-timeline-sidebar-view"] .timeline-date-group {
	margin-bottom: var(--size-4-2);
	position: relative;
	border-radius: var(--radius-m);
	transition: all 0.3s ease;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-date-group.is-today {
	background-color: var(--background-secondary);
	border-radius: var(--radius-m);
	margin: 0 var(--size-4-2) var(--size-4-2);
	padding: var(--size-4-2);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	border: 1px solid var(--interactive-accent);
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-date-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--size-4-2) var(--size-4-4);
	font-weight: 600;
	font-size: var(--font-ui-small);
	color: var(--text-accent);
	border-bottom: 1px solid var(--background-modifier-border);
	margin-bottom: var(--size-4-2);
	position: sticky;
	top: 0;
	background-color: var(--background-primary);
	z-index: 1;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-date-group.is-today
	.timeline-date-header {
	border-radius: var(--radius-s);
	margin: 0 0 var(--size-4-2) 0;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-date-relative {
	font-size: var(--font-ui-smaller);
	color: var(--text-muted);
	font-weight: normal;
}

/* Events List */
div[data-type^="tg-timeline-sidebar-view"] .timeline-events-list {
	display: flex;
	flex-direction: column;
	gap: var(--size-2-1);
	padding: 0 var(--size-2-3);
}

/* Timeline Events */
div[data-type^="tg-timeline-sidebar-view"] .timeline-event {
	display: flex;
	align-items: flex-start;
	gap: var(--size-4-3);
	padding: var(--size-4-3);
	border-radius: var(--radius-m);
	cursor: pointer;
	position: relative;
	border: 1px solid transparent;
	margin-bottom: var(--size-4-2);
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-event:hover {
	background-color: var(--background-modifier-hover);
	border-color: var(--interactive-accent);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	transform: translateY(-1px);
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event:hover:has(.timeline-event-checkbox:hover) {
	transform: none;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-event.is-completed {
	opacity: 0.6;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event.is-completed
	.timeline-event-text {
	text-decoration: line-through;
	color: var(--text-muted);
}

/* Event Time */
div[data-type^="tg-timeline-sidebar-view"] .timeline-event-time {
	font-size: var(--font-ui-smaller);
	color: var(--text-muted);
	font-family: var(--font-monospace);
	min-width: 45px;
	text-align: center;
	margin-top: 2px;
	flex-shrink: 0;
	background-color: var(--background-modifier-border);
	border-radius: var(--radius-s);
	padding: var(--size-4-1) var(--size-4-2);
	font-weight: 500;
}

/* Event Content */
div[data-type^="tg-timeline-sidebar-view"] .timeline-event-content {
	flex: 1;
	display: flex;
	align-items: flex-start;
	gap: var(--size-4-2);
	min-width: 0;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-event-checkbox {
	display: flex;
	align-items: center;
	margin-top: 2px;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-checkbox
	input[type="checkbox"] {
	margin: 0;
	cursor: pointer;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-event-text {
	flex: 1;
	font-size: var(--font-ui-small);
	line-height: 1.4;
	word-wrap: break-word;
	color: var(--text-normal);
	display: flex;
	align-items: flex-start;
	gap: var(--size-4-2);
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-event-icon {
	font-size: var(--font-ui-medium);
	flex-shrink: 0;
	margin-top: 1px;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-event-content-text {
	flex: 1;
	word-break: break-word;
}

/* Event Actions */
div[data-type^="tg-timeline-sidebar-view"] .timeline-event-actions {
	display: flex;
	gap: var(--size-4-1);
	opacity: 0;
	transition: opacity 0.2s ease;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event:hover
	.timeline-event-actions {
	opacity: 1;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-event-action {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--size-4-6);
	height: var(--size-4-6);
	border-radius: var(--radius-s);
	cursor: pointer;
	color: var(--text-muted);
	background-color: transparent;
	transition: all 0.2s ease;
}

div[data-type^="tg-timeline-sidebar-view"] .timeline-event-action:hover {
	color: var(--text-normal);
	background-color: var(--background-modifier-border);
}

/* Quick Input Area */
div[data-type^="tg-timeline-sidebar-view"] .timeline-quick-input {
	flex-shrink: 0;
	border-top: 1px solid var(--background-modifier-border);
	background-color: var(--background-secondary);
	padding: var(--size-4-4);
	display: flex;
	flex-direction: column;
	gap: var(--size-4-3);
	padding-bottom: var(--size-4-12);
}

div[data-type^="tg-timeline-sidebar-view"] .quick-input-header {
	display: flex;
	flex-direction: column;
	gap: var(--size-4-1);
	margin-bottom: var(--size-4-2);
}

div[data-type^="tg-timeline-sidebar-view"] .quick-input-title {
	font-weight: 600;
	font-size: var(--font-ui-small);
	color: var(--text-normal);
}

div[data-type^="tg-timeline-sidebar-view"] .quick-input-target-info {
	font-size: var(--font-ui-smaller);
	color: var(--text-muted);
	font-style: italic;
	padding: var(--size-4-1) var(--size-4-2);
	background-color: var(--background-modifier-hover);
	border-radius: var(--radius-s);
	border-left: 3px solid var(--interactive-accent);
	word-break: break-all;
}

div[data-type^="tg-timeline-sidebar-view"] .quick-input-editor {
	min-height: 80px;
	border: 2px solid var(--background-modifier-border);
	border-radius: var(--radius-m);
	background-color: var(--background-primary);
	padding: var(--size-4-3);
	font-family: var(--font-text);
	font-size: var(--font-ui-small);
	resize: vertical;
	transition: all 0.3s ease;
}

div[data-type^="tg-timeline-sidebar-view"] .quick-input-editor:focus-within {
	border-color: var(--interactive-accent);
	box-shadow: 0 0 0 2px rgba(var(--interactive-accent-rgb), 0.2);
}

div[data-type^="tg-timeline-sidebar-view"] .quick-input-editor .cm-editor {
	background-color: transparent;
	border: none;
	outline: none;
}

div[data-type^="tg-timeline-sidebar-view"] .quick-input-editor .cm-focused {
	outline: none;
}

div[data-type^="tg-timeline-sidebar-view"]
	.quick-input-editor
	.cm-editor.cm-focused {
	outline: none;
}

div[data-type^="tg-timeline-sidebar-view"] .quick-input-actions {
	display: flex;
	gap: var(--size-4-2);
	justify-content: flex-end;
}

div[data-type^="tg-timeline-sidebar-view"] .quick-capture-btn,
div[data-type^="tg-timeline-sidebar-view"] .quick-modal-btn {
	padding: var(--size-4-3) var(--size-4-6);
	border-radius: var(--radius-m);
	font-size: var(--font-ui-small);
	font-weight: 500;
	cursor: pointer;
	border: none;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

div[data-type^="tg-timeline-sidebar-view"] .quick-capture-btn {
	background-color: var(--interactive-accent);
	color: var(--text-on-accent);
}

div[data-type^="tg-timeline-sidebar-view"] .quick-capture-btn:hover {
	background-color: var(--interactive-accent-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

div[data-type^="tg-timeline-sidebar-view"] .quick-modal-btn {
	background-color: var(--background-modifier-border);
	color: var(--text-normal);
}

div[data-type^="tg-timeline-sidebar-view"] .quick-modal-btn:hover {
	background-color: var(--background-modifier-border-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
	div[data-type^="tg-timeline-sidebar-view"] .timeline-header {
		padding: var(--size-4-2) var(--size-4-3);
	}

	div[data-type^="tg-timeline-sidebar-view"] .timeline-controls {
		gap: var(--size-4-1);
	}

	div[data-type^="tg-timeline-sidebar-view"] .timeline-btn {
		width: var(--size-4-7);
		height: var(--size-4-7);
	}

	div[data-type^="tg-timeline-sidebar-view"] .timeline-events-list {
		padding: 0 var(--size-2-3);
	}

	div[data-type^="tg-timeline-sidebar-view"] .timeline-event {
		padding: var(--size-4-2);
	}

	div[data-type^="tg-timeline-sidebar-view"] .timeline-quick-input {
		padding: var(--size-4-3);
	}

	div[data-type^="tg-timeline-sidebar-view"] .quick-input-editor {
		min-height: 60px;
	}
}

/* Scrollbar Styling */
div[data-type^="tg-timeline-sidebar-view"]
	.timeline-content::-webkit-scrollbar {
	width: 6px;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-content::-webkit-scrollbar-track {
	background-color: var(--background-secondary);
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-content::-webkit-scrollbar-thumb {
	background-color: var(--background-modifier-border);
	border-radius: 3px;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-content::-webkit-scrollbar-thumb:hover {
	background-color: var(--background-modifier-border-hover);
}

/* Animation */
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Focus Mode */
div[data-type^="tg-timeline-sidebar-view"] .timeline-content.focus-mode {
	position: relative;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-content.focus-mode::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		to bottom,
		rgba(var(--background-primary-rgb), 0.9) 0%,
		rgba(var(--background-primary-rgb), 0.7) 50%,
		rgba(var(--background-primary-rgb), 0.9) 100%
	);
	pointer-events: none;
	z-index: 0;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-content.focus-mode
	.timeline-date-group.is-today {
	position: relative;
	z-index: 1;
}

/* Markdown renderer styles in timeline events */
div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	p {
	margin: 0;
	padding: 0;
	font-size: inherit;
	line-height: inherit;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	strong,
div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	em,
div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	code {
	font-size: inherit;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	a {
	color: var(--link-color);
	text-decoration: none;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	a:hover {
	text-decoration: underline;
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	ul,
div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	ol {
	margin: 0;
	padding-left: var(--size-4-4);
}

div[data-type^="tg-timeline-sidebar-view"]
	.timeline-event-content-text
	.markdown-block
	li {
	margin: 0;
	padding: 0;
}
